from django.shortcuts import render
from django.http import Http404
from .models import Player


# Create your views here.
def index(request):
    try:
        all_players = Player.objects.order_by('name')
    except Player.DoesNotExist:
        raise Http404("Player does not exist")
    context = {'players': all_players}
    return render(request, 'index.html', context)

def chatroom(request):

    return render(request, 'chatroom.html')